#include "QRenderPoint.h"

QRenderPoint::QRenderPoint(QWidget *parent, int size, QColor color)
    : QWidget(parent)
{
    this->size = size;
    this->setMinimumSize(QSize(size, size));
    this->setMaximumSize(QSize(size, size));

    this->brush = QBrush(color);
    this->brush.setStyle(Qt::RadialGradientPattern);

    this->width = 2;
    this->pen = QPen(QBrush(Qt::black), width);
}

QRenderPoint::~QRenderPoint(void)
{

}

void QRenderPoint::paintEvent(QPaintEvent* event)
{
    QPainter painter(this);
    painter.setRenderHint(QPainter::Antialiasing, true);
    painter.setBrush(brush);
    painter.setPen(pen);
    painter.drawEllipse(width, width, size - width * 2, size - width * 2);
}